﻿using HandyControl.Controls;
using HandyControl.Data;

namespace Koala.Pro.Helpers
{
    public static class GrowlUtil
    {
        public static void ShowInfo(string message, bool clearTips = true)
        {
            if (clearTips)
            {
                ClearTips();
            }
            Growl.InfoGlobal(message);
        }

        public static void ShowError(string message, bool clearTips = true)
        {
            if (clearTips)
            {
                ClearTips();
            }
            Growl.ErrorGlobal(message);
        }

        public static void ShowWarn(string message, bool clearTips = true)
        {
            if (clearTips)
            {
                ClearTips();
            }
            Growl.WarningGlobal(message);
        }

        public static void ShowSuccess(string message, bool clearTips = true)
        {
            if (clearTips)
            {
                ClearTips();
            }
            Growl.SuccessGlobal(message);
        }

        public static void ShowFatal(string message, bool clearTips = true)
        {
            if (clearTips)
            {
                ClearTips();
            }
            Growl.FatalGlobal(message);
        }

        public static void ClearTips()
        {
            Growl.ClearGlobal();
        }

        public static void ShowAsk(string message, Func<bool, bool> actionBeforeClose)
        {
            Growl.AskGlobal(message, actionBeforeClose);
        }

        public static void Notify(object message, ShowAnimation animation = ShowAnimation.Fade, bool staysOpen = false)
        {
            Notification.Show(message, animation, staysOpen);
        }
    }

}
